$(document).ready(function () {
 /* layui.use(['carousel', 'form'], function(){
    var carousel = layui.carousel
      ,form = layui.form;

    //常规轮播
    carousel.render({
      elem: '#test1'
      ,arrow: 'always'
    });



    var $ = layui.$, active = {
      set: function(othis){
        var THIS = 'layui-bg-normal'
          ,key = othis.data('key')
          ,options = {};

        othis.css('background-color', '#5FB878').siblings().removeAttr('style');
        options[key] = othis.data('value');
        ins3.reload(options);
      }
    };

    //监听开关
    form.on('switch(autoplay)', function(){
      ins3.reload({
        autoplay: this.checked
      });
    });

    $('.demoSet').on('keyup', function(){
      var value = this.value
        ,options = {};
      if(!/^\d+$/.test(value)) return;

      options[this.name] = value;
      ins3.reload(options);
    });

    //其它示例
    $('.demoTest .layui-btn').on('click', function(){
      var othis = $(this), type = othis.data('type');
      active[type] ? active[type].call(this, othis) : '';
    });
  });*/

  var url = "http://127.0.0.1:8080/homework_war_exploded/";
  $("#sea").click(function () {
    $.ajax({
      type: "get",
      url: url + "user/getUserList.do",
      dataType: "json",
      success: function (v) {
        if (v.success){
          /*layer.alert('获取数据成功');
          alert(v.data);*/
          var t = '';
          $.each(v.data,function (index, obj) {
          t += "<tr>"
            +"<td>"+obj.user_account+"</td>"
            +"<td>"+obj.user_name+"</td>"
            +"</tr>";
          })
          t
        }else {
          layer.alert("查询失败");
        }
      }
    });
  });
});
